from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import cases

router = DefaultRouter()
router.register(r"", cases.CaseViewSet, basename="Cases")
router.register(r"(?P<case_pk>\d+)/steps", cases.CaseStepViewSet, basename="CaseStep")

urlpatterns = [
    path("home/", cases.CaseView.as_view(), name="CasesHome"),
    path("", include(router.urls)),
    path("create-case/", cases.create_case, name="createCase"),
    # 用例编辑页
    path("<int:case_id>/edit/", cases.case_edit_view, name="caseEdit"),
    path("delete-cases/", cases.CaseBulkDeleteView.as_view(), name="bulk-delete-cases"),
]
